<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>思途CMS{$coreVersion}</title>
    {template 'stourtravel/public/public_min_js'}
    {php echo Common::getCss('style.css,base.css,base2.css,base_new.css,order.show.css'); }
    {php echo Common::getScript("jquery.validate.js"); }
    {php echo Common::getScript("choose.js"); }

    <style>
        .error{
            color:red;
            padding-left:5px;
        }
        .hide{
            display: none;
        }

    </style>

</head>
<body style="background-color: #fff">
<table class="content-tab">
    <tr>
        <td width="119px" class="content-lt-td" valign="top">
            {template 'stourtravel/public/leftnav'}
            <!--右侧内容区-->
        </td>
        <td valign="top" class="content-rt-td">



            <form id="frm" name="frm">
                <div id="product_grid_panel" class="manage-nr">
                    <div class="cfg-header-bar">
                        <a href="javascript:;" class="fr btn btn-primary radius mr-10 mt-6" onclick="window.location.reload()">刷新</a>
                    </div>

                    <div class="product-add-div order-show-container pd-10" >
                        <div class="order-show-wrap mb-10">
                            <div class="order-show-bar">
                                <span class="order-bar-tit c-primary">基本信息</span>
                            </div>
                            <div class="order-show-block">
                                <ul class="info-item-block">

                                    <li>
                                        <span class="item-hd">会员昵称：</span>
                                        <div class="item-bd">
                                            <span class="item-text c-666">{$info['nickname']}</span>
                                        </div>
                                    </li>
                                    <li>
                                        <span class="item-hd">会员账号：</span>
                                        <div class="item-bd">
                                            <span class="item-text c-666">{$info['account']}</span>
                                        </div>
                                    </li>

                                </ul>
                            </div>
                        </div>
                        <div class="order-show-wrap mb-10">
                            <div class="order-show-bar">
                                <span class="order-bar-tit c-primary">申请提现信息</span>
                            </div>
                            <div class="order-show-block">
                                <ul class="info-item-block">

                                    <li>
                                        <span class="item-hd">申请时间：</span>
                                        <div class="item-bd">
                                            <span class="item-text c-666">{date('Y-m-d H:i:s',$info['addtime'])}</span>
                                        </div>
                                    </li>
                                    <li>
                                        <span class="item-hd">申请说明：</span>
                                        <div class="item-bd lh-30">
                                            {$info['description']}
                                        </div>
                                    </li>
                                    <li>
                                        <span class="item-hd">提现金额：</span>
                                        <div class="item-bd">
                                            <span class="item-text c-orange">&yen;{$info['withdrawamount']}</span>
                                        </div>
                                    </li>

                                </ul>
                            </div>
                        </div>
                        <div class="order-show-wrap mb-10">
                            <div class="order-show-bar">
                                <span class="order-bar-tit c-primary">收款信息</span>
                            </div>
                            <div class="order-show-block">
                                <ul class="info-item-block">

                                    <li>
                                        <span class="item-hd">提款到：</span>
                                        <div class="item-bd">
                                            <span class="item-text c-666">{$info['way_name']}</span>
                                        </div>
                                    </li>
                                    {if $info['account']}
                                    <li>
                                        <span class="item-hd">提现账号：</span>
                                        <div class="item-bd">
                                            <span class="item-text c-666">{$info['account']}</span>
                                        </div>
                                    </li>
                                    {/if}
                                    {if $info['way']=='bank'}
                                    <li>
                                        <span class="item-hd">开户行名称：</span>
                                        <div class="item-bd lh-30">
                                            {$info['bankname']}
                                        </div>
                                    </li>
                                    {/if}
                                    {if $info['bankaccountname']}
                                    <li>
                                        <span class="item-hd">帐户姓名：</span>
                                        <div class="item-bd lh-30">
                                            {$info['bankaccountname']}
                                        </div>
                                    </li>
                                    {/if}
                                    {if $info['bankcardnumber']}
                                    <li>
                                        <span class="item-hd">{$info['way_name']}账号：</span>
                                        <div class="item-bd lh-30">
                                            {$info['bankcardnumber']}
                                        </div>
                                    </li>
                                    {/if}

                                </ul>
                            </div>
                        </div>
                        <div class="order-show-wrap mb-10">
                            <div class="order-show-bar">
                                <span class="order-bar-tit c-primary">提现状态</span>
                            </div>
                            <div class="order-show-block">
                                <ul class="info-item-block">
                                    <li>
                                        <span class="item-hd">当前状态：</span>
                                        <div class="item-bd lh-30">
                                            {if $info['status']==0}申请中{/if}
                                            {if $info['status']==1}已完成{/if}
                                            {if $info['status']==2}未通过{/if}
                                            {if $info['status']==3}微信商户后台审核中{/if}
                                        </div>
                                    </li>



                                </ul>
                            </div>
                        </div>

                        {if $info['status']==1}
                        <div class="order-show-wrap mb-10">
                            <div class="order-show-bar">
                                <span class="order-bar-tit c-primary">付款信息</span>
                            </div>
                            <div class="order-show-block">
                                <ul class="info-item-block">
                                    {if $info['audit_admin']}
                                    <li>
                                        <span class="item-hd">平台操作员：</span>
                                        <div class="item-bd lh-30">
                                            {$info['audit_admin']}
                                        </div>
                                    </li>
                                    {/if}
                                    <li>
                                        <span class="item-hd">操作时间：</span>
                                        <div class="item-bd lh-30">
                                            {date('Y-m-d H:i:s',$info['finishtime'])}
                                        </div>
                                    </li>
                                    {if $info['status']!=0}
                                    <li>
                                        <span class="item-hd">平台说明：</span>
                                        <div class="item-bd lh-30">
                                            {$info['audit_description']}
                                        </div>
                                    </li>
                                    {/if}
                                </ul>
                            </div>
                        </div>
                        {elseif $info[status]==2||$info[status]==3}
                        <div class="order-show-wrap mb-10">
                            <div class="order-show-bar">
                                <span class="order-bar-tit c-primary">付款信息</span>
                            </div>
                            <div class="order-show-block">
                                <ul class="info-item-block">
                                    <li>
                                        <span class="item-hd">平台说明：</span>
                                        <div class="item-bd lh-30">
                                            {$info['audit_description']}
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        {/if}



                        <!-- 订单信息 -->

                        <div>
                            <input type="hidden" id="field_audit_description" name="audit_description" value=""/>
                            <input type="hidden" id="field_status" name="status" value="{$info['status']}"/>
                            <input type="hidden" id="id" name="id" value="{$info['id']}">
                            <input type="hidden" id="way" name="way" value="{$info['way']}">
                        </div>

                        <div class="pt-5">

                            <ul class="info-item-block">
                                <li>
                                    <span class="item-hd"></span>
                                    <div class="item-bd lh-30">
                                        {if $info['way']=='alipay' && $info['status']==0}
                                        <a class="btn btn-primary radius mr-20  withdraw_btn"  href="javascript:;">支付宝打款</a>
                                        {/if}
                                        {if $info['way']=='weixin' && $info['status']==0}
                                        <a class="btn btn-primary radius mr-20 withdraw_btn"  href="javascript:;">微信打款</a>
                                        {/if}
                                        {if $info['status']==0}
                                        <a class="btn btn-primary radius mr-20" id="btn_save" href="javascript:;">线下打款</a>
                                        <a class="btn btn-primary radius mr-20" id="btn_refuse" href="javascript:;">拒绝提现</a>
                                        {/if}
                                    </div>
                                </li>
                            </ul>
                            <ul class="info-item-block">
                                <li>
                                    <span class="item-hd"></span>
                                    <div>
                                        {if $info['status']==0} 注：微信小程序需要在"微信端"->"小程序"配置appid；公众号需要在"支付接口"->"微信"配置公众帐号ID，程序会根据用户注册来源使用对应的配置{/if}
                                    </div>
                                </li>
                            </ul>

                        </div>

                    </div>
            </form>
        </td>
    </tr>
</table>


<script language="JavaScript">
    var old_status="{$info['status']}";
    $(function(){

        $("#btn_save").click(function(){
            ST.Util.showBox("线下打款说明",SITEURL+'{$prefix_url}/withdraw/dialog_withdraw_check',500,'',null,null,document,{loadWindow: window, loadCallback: offline_check});







        });

        //拒绝请求
        $("#btn_refuse").click(function(){
            ST.Util.showBox("拒绝提现说明",SITEURL+'{$prefix_url}/withdraw/dialog_withdraw_check',500,'',null,null,document,{loadWindow: window, loadCallback: refuse_check});
        });

        function offline_check(data)
        {
            if(data.status==1)
            {
                $("#field_status").val(1);
                $("#field_audit_description").val(data.audit_description);
                save_confirm();
            }
        }
        function refuse_check(data)
        {
            if(data.status==1)
            {
                $("#field_status").val(2);
                $("#field_audit_description").val(data.audit_description);
                save_confirm();
            }
        }

        function save_confirm()
        {
            $.ajaxform({
                url   :  SITEURL+"{$prefix_url}/withdraw/ajax_withdraw_save",
                method  :  "POST",
                form  : "#frm",
                dataType:'json',
                success  :  function(data)
                {
                    if(data.status)
                    {
                        ST.Util.showMsg(data.msg,'4',2000);
                        setTimeout(function(){window.location.reload()},2000);
                    }
                    else
                    {
                        ST.Util.showMsg(data.msg,'5',2000);
                    }

                }});
        }
        //支付宝 微信提现
        $(".withdraw_btn").click(function(){
            var pre_hint = '';
            var tit = $(this).text();
            ST.Util.confirmBox("提示", pre_hint+"是否使用"+tit+"功能？", function () {
                $.ajaxform({
                    url   :  SITEURL+"{$prefix_url}/withdraw/ajax_withdraw_btn_save",
                    method  :  "POST",
                    form  : "#frm",
                    dataType:'json',
                    success  :  function(data)
                    {
                        if(data.status)
                        {
                            ST.Util.showMsg(data.msg,'4',2000);
                            setTimeout(function()
                            {
                                window.location.reload()
                            },2000)
                        }
                        else
                        {
                            ST.Util.showMsg(data.msg,'5',4000);
                        }

                    }});
            })

        });




    })





</script>

</body>
</html>